//package com.zeta.eduservice.controller.Rubbish;
//
//
//import java.util.ArrayList;
//import java.util.Collection;
//import java.util.List;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.CrossOrigin;
//import org.springframework.web.bind.annotation.DeleteMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.PutMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.zeta.commonutils.R;
//import com.zeta.eduservice.entity.question.EduQuestionAndFolder;
//import com.zeta.eduservice.service.EduQuestionAndFolderService;
//
//import lombok.Delegate;
//
///**
// * <p>
// * 题目和文件夹中间表 前端控制器
// * </p>
// *
// * @author zeta
// * @param <E>
// * @since 2020-10-10
// */
//@CrossOrigin
//@RestController
//@RequestMapping("/eduservice/question_and_folder")
//public class EduQuestionAndFolderController<E> {
//
//	@Autowired
//	EduQuestionAndFolderService service;
//	@PostMapping("")
//	public R addList(@RequestBody String list) {
//		JSONObject j1 = JSONObject.parseObject(list);
//	 String string = j1.getString("list");
//	 JSONArray parseArray = JSONObject.parseArray(string);
//		List<String> nodes = JSONObject.parseArray(parseArray.toJSONString(), String.class);
//		String string2 = j1.getString("folderId");
//			List<EduQuestionAndFolder> entityList=new ArrayList<EduQuestionAndFolder>();
//		for(String i:nodes) {
//			EduQuestionAndFolder eduQuestionAndFolder = new EduQuestionAndFolder();
//			eduQuestionAndFolder.setFolderId(string2);
//			eduQuestionAndFolder.setQuestionId(i);
//			entityList.add(eduQuestionAndFolder);
//		}
//		
//		service.saveOrUpdateBatch(entityList);
//		return  R.ok();
//	}
//	@PutMapping("list")
//	public R updatelist(@RequestBody String list) {
//		
//		
//		JSONArray parseArray2 = JSONObject.parseArray(list);
//		List<EduQuestionAndFolder> parseArray = JSONObject.parseArray(parseArray2.toJSONString(),EduQuestionAndFolder.class);
//
//		
//		boolean saveOrUpdateBatch = service.saveOrUpdateBatch(parseArray);
//		return R.ok();
//	}
//	@DeleteMapping("{id}")
//	public R delete(@PathVariable String id) {
//		boolean removeById = service.removeById(id);
//		return R.ok();
//	}
//}
//
